require 'openssl'

module Random
  def self.pseudo_bytes(num_bytes)
    Array.new(num_bytes) { rand(256) }.pack("C*")
  end

  def self.dev_bytes(num_bytes)
    IO.read('/dev/random', num_bytes)
  end

  def self.openssl_bytes(num_bytes)
    OpenSSL::Random.random_bytes(num_bytes)
  end
end
